package com.zjt.utils;

import org.webharvest.definition.ScraperConfiguration;
import org.webharvest.runtime.Scraper;

import java.io.IOException;
public class SearchAndDownload {
    //private static Logger logger = LoggerFactory.getLogger(ImageUtil.class);
	private static String outputBasePath = "/Users/xueyanbeijing/Documents/svn/zjt-server/src/outputxml/";
	private static String templateBasePath = "/Users/xueyanbeijing/Documents/svn/zjt-server/src/xmltemplate/";

	public static void main(String[] args) throws IOException {

        //downHttpHtmlToXML("really100/really100_classic.xml");
        //downHttpHtmlToXML("really100/really100_shi_content.xml");
        //downHttpHtmlToXML("really100/really100_xing_content.xml");
        //downHttpHtmlToXML("really100/really100_yi_content.xml");
        //downHttpHtmlToXML("really100/really100_yong_content.xml");
        //downHttpHtmlToXML("really100/really100_zhu_content.xml");
        //downHttpHtmlToXML("yanyue/yanyue_bc.xml");
	
	
	}
	 /**
     * @throws IOException
     */
    public static void downHttpHtmlToXML(String xmlTemplate) throws IOException
    {
   	System.out.println("xmlTemplate start:"+xmlTemplate);
   	 ScraperConfiguration config = new ScraperConfiguration(templateBasePath+xmlTemplate);
     Scraper scraper = new Scraper(config, outputBasePath);
     scraper.execute();
     System.out.println("xmlTemplate end:"+xmlTemplate);
    }

}